{include file='comdir/head.html'}
<link href="{$_URL}static/admin/css/evol.colorpicker.min.css" rel="stylesheet">
<script src="{$_URL}static/js/jquery-ui-1.10.2.js"></script>
<script src="{$_URL}static/js/evol.colorpicker.min.js"></script>
<style type="text/css">
{literal}
.col-lg-3,.col-lg-7,.col-lg-1,.col-lg-11{width: 200px;display: inline;float: none;}
.form-control{display: inline;width: 200px;}
#cpButton{display: inline;width:100px;vertical-align: middle;}
.evo-cp-wrap{display: inline;}
.video_url{width:44.5%;}
.select_select_size{width:65px;}
.title_size{width:60px;display:inline-block;text-align: right;}
.title_width{width:44.5%;}
.textarea_size{width:600px;height: 500px;vertical-align: middle;}
.input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block {width:100px;margin-left: 75px;}
.hits{width:100px;}
{/literal}
</style>
<body>
<div class="content">
	<div class="animated fadeInDown">
		<div class="pos"><a href="#" onClick="javascript :history.back(-1);">返回上一页</a></div>
		<form class="form-horizontal article" action="javascript:void(0)" id='frm'>
			<div class="form-group">
				<span class="title_size">栏目</span>
				<div class="col-lg-3">
					<select class="form-control columnselected" name="colid">
						<option value="">选择栏目</option>>
						{$columnselected}
					</select>
					<input type="hidden" class='sitesid' name="sitesid" value="">
				</div>
				<span class="title_size">专题</span>
				<div class="col-lg-3">
					<select class="form-control specialid" name="specialid">
						<option value=''>专题选择</option>
						{foreach from=$speciallist item=vo}
							<option value='{$vo.id}'>{$vo.name}</option>
						{/foreach}
					</select>
				</div>
				<span class="title_size">内容分类</span>
				<!-- <label class="col-lg-1 control-label">内容分类</label> -->
				<div class="col-lg-3 specialcontnetadd">
					<select class="form-control specialtypeid" name="specialtypeid">
						<option value=''>专题内容分类选择</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<span class="title_size">标题</span>
			<!-- 	<label class="col-lg-1 control-label">标题</label> -->
				<div class="col-lg-7">
					<input type="text" class="form-control title_width" name="title">
				</div>
				<span class="title_size">颜色</span>
				<!-- <label class="col-lg-1 control-label">颜色</label> -->
				<div class="col-lg-3">
					<input id="cpButton" class="form-control" name="titilecolor" value="#000"  />
				</div>
			</div>
			<div class="form-group">
			<span class="title_size">来源</span>
				<!-- <label class="col-lg-1 control-label">来源</label> -->
				<div class="col-lg-3">
					<input type="text" class="form-control" name="copyfrom">
				</div>
				<span class="title_size">审核人</span>
				<!-- <label class="col-lg-1 control-label">审核人</label> -->
				<div class="col-lg-1">
					<input type="text" class="form-control" name="verifyuser">
				</div>
				<span class="title_size">终审人</span>
				<!-- <label class="col-lg-1 control-label">终审人</label> -->
				<div class="col-lg-1">
					<input type="text" class="form-control" name="finalverify">
				</div>
			</div>
			<div class="form-group">
			<span class="title_size">视频URL</span>
			<!-- 	<label class="col-lg-1 control-label">视频</label> -->
				<div class="col-lg-11">
					<input type="text" class="form-control video_url" name="mediafile">
				</div>
			</div>
			<div class="form-group img_show_hide" style="display: none;">
			<span class="title_size">显示图片</span>
				<!-- <label class="col-lg-1 control-label">图片</label> -->
				<div class="col-lg-11">
					<img class="show_article" style="width:100px;height:30px;margin-bottom: 5px;" src="" />
					<div class="checkbox checkbox-inline">
						<input type="checkbox" id="delupload1" class='delupload' value="0">
						<label for="delupload1">取消标题图片</label>
					</div>
				</div>
			</div>
			<div class="form-group">
			<span class="title_size">图片</span>
				<!-- <label class="col-lg-1 control-label">图片</label> -->
				<div class="col-lg-11">
					<input type="hidden" value="" name="defaultpicurl" class="article">
					<div class="iframe-box btn-blue">
						<iframe id="upiframe" frameborder="0" scrolling="no" src="{$_URL}Ups/upone?method=article&classname=article&callback=articleback"></iframe>
					</div>
				</div>
			</div>
			<div class="form-group">
			<span class="title_size">点击量</span>
				<!-- <label class="col-lg-1 control-label">点击数</label> -->
				<div class="col-lg-1">
					<input type="text" class="form-control hits" name="hits" value="">
				</div>
				<span class="title_size">推荐</span>
				<!-- <label class="col-lg-1 control-label">推荐</label> -->
				<div class="col-lg-1">
					<select class="form-control select_select_size" name="recommendflag">
						<option value='0' selected>否</option>
						<option value='1'>是</option>
					</select>
				</div>
				<span class="title_size">置顶</span>
				<!-- <label class="col-lg-1 control-label">置顶</label> -->
				<div class="col-lg-1">
					<select class="form-control select_select_size" name="headflag">
						<option value='0' selected>否</option>
						<option value='1'>是</option>
					</select>
				</div>
				<span class="title_size">审核</span>
				<!-- <label class="col-lg-1 control-label">审核</label> -->
				<div class="col-lg-1">
					<select class="form-control select_select_size" name="verify" >
						<option value='0' >否</option>
						<option value='1' selected>是</option>
					</select>
				</div>
			</div>
			<div class="form-group">
			<span class="title_size">简介</span>
				<!-- <label class="col-lg-1 control-label">简介</label> -->
				<div class="col-lg-11"><textarea class="form-control textarea_size" name="intro"></textarea></div>
			</div>
			<div class="form-group">
			<span class="title_size">内容</span>
				<!-- <label class="col-lg-1 control-label">内容</label> -->
				
					{include file='comdir/ueditor.html'}
				
			</div>
			<div class="form-group">
				<div class="col-lg-offset-1 col-lg-11">
					<input type="button" class="btn btn-block btn-blue sub" name="name" value="提交">
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	$('#cpButton').colorpicker({
		showOn:'button'
	});
	var _URL='{$_URL}';
	{literal}
		function articleback(data){
			var classname=data.classname;
			$('.'+classname).val(data.img);
			$('.img_show_hide').show();
			$('.show_'+classname).attr('src',data.imgshow);
		}
		$(function(){
			//取消图片
			$('.delupload').change(function(){
				var value=$(this).is(':checked');
				if(value){
					$('.img_show_hide').hide();
					$('.article').val('');
					$(this).val(1);
				}else{
					$(this).val(0);
				}

			})
			//选择栏目获取站点id
			$('.columnselected').change(function(){
				var sitesid=$('.columnselected').find('option:selected').attr('data-sites');
				$('.sitesid').val(sitesid);
			})
			//专题分类事件
			$('.specialid').change(function(){
				var specialid=$(this).val();
				if(specialid==''){return false;}
				var url=_URL+'Article/add';
				_ajaxs.post(url,'specialcontenttype=1&specialid='+specialid,function(data){
					var html='';
					html+='<select class="form-control specialtypeid" name="specialtypeid">';

					if(!data.status){
						html+='<option value="">无专题内容分类</option>';
					}else{
						var list=data.data;
						var list_length=list.length;
						for(i=0;i<list_length;i++){
							html+='<option value="'+list[i]['id']+'">'+list[i]['ctypename']+'</option>';
						}
					}

					html+='</select>';
					$('.specialtypeid').remove();
					$('.specialcontnetadd').html(html);
				})
			})
			
			var subadd=true;
			$('.sub').click(function(){
				var url=_URL+"Article/add";
				var formjquery=_ajaxs.from('#frm');
				if(!subadd){return false;}
				//subadd=false;
				_ajaxs.post(url,'formjquery='+formjquery,function _result(data){
					subadd=true;
					layer.msg(data.msg,{icon: 1}, function(){
						if(data.status){
							window.location.href=_URL+"Article/add";
						}
					});

				});
			})
		})
	{/literal}
</script>
</body>
</html>
